import { defineStore } from "pinia";

export interface DynamicRouteProps {
    menuText: string;
    path: string;
    route: string;
  }
export interface UserDataProps {
    agencyName: string;
    agencyid: string;
    departMentName: string;
    departMentid: string;
    loginName: string;
    ltoken: string;
    menuVoList: DynamicRouteProps[];
    name: string;
    roleid: string|number;
}

export const useUserStore = defineStore({
    id: 'userStore',
    state: () => ({
        userData:<UserDataProps>{}
    }),
    actions: {
        setUserData(data: UserDataProps) {
            this.userData = { ...data }
        }
    },
    persist: true
})